﻿@model int

@{
    ViewBag.Title = "Manage Clients";
}

<div id="Wrapper2">
    <div id="content_header">
        <div id="headerimage">
        </div>
        <div id="theheader">@ViewBag.Header</div>
    </div>
    <!-- Left Column begins here -->
    <aside id="sidebar-wrapper">
        <nav class="sidebar">
            <!-- CONTENT GOES HERE -->
            @Html.ActionLink("Back to Index", "Index")
            <br /><br />
            @{
                string deleteNum = " ";
                
                if(Model != -1)
                {
                    deleteNum = "Deleted " + Model + " clients.";
                }
                <span style="color:red;">@deleteNum</span>
            }

            @using (Html.BeginForm("ManageClients", "Admin", FormMethod.Post, new { id = "deleteClients" }))
            {
                <div>Delete all clients who have not made a reservation in&nbsp;
                    <select name="days">
                        <option value="25">25</option>
                        <option value="50">50</option>
                        <option value="75">75</option>
                        <option value="100">100</option>
                        <option value="365">365</option>
                    </select>
                    &nbsp;days
                </div>
                <br />
                <input type="submit" name="btnSubmit" value="Delete" />
                <br />
                <br />
                <br />
                <br />
                <br />
                <fieldset>
                    <legend>DELETE INFORMATION</legend>
                    This will permanently delete all clients who have not confirmed a reservation in the selected number of days. Clients who have a confirmed reservation
                    (i.e. those who have made a deposit) will be preserved. Clients who have been deleted cannot be recovered.<br /><br />
                    All tasks, payments, and reservations associated with the deleted clients will also be deleted.
                </fieldset>
            }
        </nav>
    </aside>
    <!-- Right column begins here -->
    <article id="contents">
        
    </article>
    <!-- Right column ends here -->
</div>
<!-- Div wrapper2 ends here -->

<script>
    $("#deleteClients").submit(function () {
        //Be sure the user wants to continue
        var message = "Are you sure?\n\nThe deleted clients cannot be recovered.";

        if (confirm(message))
            return true;
        else
            return false;
    })
</script>
